//
//  UIKitFactory.h
//  DSDeveloperKit
//
//  Created by FengDongsheng on 16/1/20.
//  Copyright © 2016年 FengDongsheng. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface UIKitFactory : NSObject

/**
*  生成UILabel
*
*  @param frame     位置
*  @param text      文字
*  @param font      字体大小
*  @param textColor 字体颜色
*  @param alignment 文字排布
*  @param superView 父试图
*
*  @return UILabel
*/
+ (UILabel *_Nullable)szb_labelWithFrame:(CGRect)frame text:(NSString *_Nullable)text font:(UIFont *_Nullable)font textColor:(UIColor *_Nullable)textColor textAlignment:(NSTextAlignment)alignment SuperView:(UIView *_Nullable)superView;





/**
 生成szb_button
 
 @param frame 位置
 @param superView 父视图
 @param imageName 图片名
 @param backImageName 背景图片名字
 @param font 字体
 @param titleColor 字体颜色
 @param backGroundColor 视图背景颜色
 @param title 标题
 @param target 事件
 @param action 行为
 @return UIButton
 */
+ (UIButton *_Nullable)szb_buttonWithFrame:(CGRect)frame superView:(nullable UIView *)superView setImage:(nullable NSString *)imageName setBackImage:(nullable NSString *)backImageName font:(nullable UIFont *)font titleColor:(nullable UIColor *)titleColor backgroundColor:(nullable UIColor *)backGroundColor  title:(nullable NSString *)title target:(nullable id)target action:(SEL _Nullable )action;



/**
 无图片，有文字的按钮

 @param frame <#frame description#>
 @param superView <#superView description#>
 @param font <#font description#>
 @param titleColor <#titleColor description#>
 @param backGroundColor <#backGroundColor description#>
 @param title <#title description#>
 @param target <#target description#>
 @param action <#action description#>
 @return <#return value description#>
 */
+ (UIButton *_Nullable)szb_titleButtonWithFrame:(CGRect)frame superView:(nullable UIView *)superView font:(nullable UIFont *)font titleColor:(nullable UIColor *)titleColor backgroundColor:(nullable UIColor *)backGroundColor  title:(nullable NSString *)title target:(nullable id)target action:(SEL _Nullable)action;


/**
 有图片，无文字的按钮

 @param frame <#frame description#>
 @param superView <#superView description#>
 @param imageName <#imageName description#>
 @param backImageName <#backImageName description#>
 @param target <#target description#>
 @param action <#action description#>
 @return <#return value description#>
 */
+ (UIButton *_Nullable)szb_imageButtonWithFrame:(CGRect)frame superView:(nullable UIView *)superView setImage:(nullable NSString *)imageName setBackImage:(nullable NSString *)backImageName target:(nullable id)target action:(SEL _Nullable)action;


/**
 *  生成UIView
 *
 *  @param frame          位置
 *  @param bgColor        背景颜色
 *  @param superView      父试图
 *
 *  @return UIView
 */
+ (UIView *_Nullable)szb_viewWithFrame:(CGRect)frame backgroundColor:(UIColor *_Nullable)bgColor superView:(UIView *_Nullable)superView;

/**
 *  生成UIImageView
 *
 *  @param frame          位置
 *  @param imageName      图片名字
 *  @param superView      父试图
 *
 *  @return UIImageView
 */
+ (UIImageView *_Nullable)szb_imageViewWithFrame:(CGRect)frame imageName:(NSString *_Nullable)imageName superView:(UIView *_Nullable)superView;



/**
 *  画虚线
 *
 *  @param Height          线高
 *  @param lineColor       线条颜色
 *  @param originX         起始位置x
 *  @param originY         起始位置y
 *  @param lineWidth       虚线的宽度
 *  @param lineBreakWidth  虚线每段宽度
 *  @param lineBreakMargin 虚线之间的间距
 *  @param superView       父试图
 *
 *  @return CAShapeLayer
 */
+ (CAShapeLayer*_Nullable)shapDottedLineHeight:(CGFloat)Height lineColor:(UIColor *_Nullable)lineColor  lineBreakWidth:(int)lineBreakWidth lineBreakMargin:(int)lineBreakMargin originX:(CGFloat)originX originY:(CGFloat)originY lineWidth:(CGFloat)lineWidth superView:(UIView *_Nullable)superView;



+ (UITextField *_Nullable)szb_textFieldWithFrame:(CGRect)frame WithPlaceholder:(NSString *_Nullable)placeholder withDelegat:(id _Nullable )delegate superView:(UIView *_Nullable)superView textAlignment:(NSTextAlignment)textAlignment textFont:(UIFont *_Nullable)font textColol:(UIColor *_Nullable)color;

/**
 设置圆角
 
 @param rect rect description
 @param radius radius description
 @return return value description
 */
+ (CAShapeLayer * _Nullable)roundedRect:(CGRect)rect cornerRadius:(CGFloat)radius;


/**
 设置选择性圆角
 
 @param rect rect description
 @param corners corners description
 @param cornerRadii radius description
 @return return value description
 */
+ (CAShapeLayer *_Nullable)roundedRect:(CGRect)rect roundingCorners:(UIRectCorner)corners cornerRadii:(CGSize)cornerRadii;


/**
 设置UITableViewStylePlain 时候控制区头不滚动
 
 @param tableview tableview
 @param sectionHeaderHeight 区头高
 @param sectionFooterHeight 区尾稿
 */
+ (void)configTableViewStylePlainWhenSectionheardViewNotScrolleWithTabView:(UITableView *_Nullable)tableview
                                                       SectionHeaderHeight:(CGFloat)sectionHeaderHeight
                                                       sectionFooterHeight:(CGFloat)sectionFooterHeight;

/**
 我是有底线的

 @param tableView tableView description
 @param pages 分页的总页数
 @param pageNum 当前页
 @param count 当前页的数据数目
 @param cellHeight cell的高度 sectionHeaderHeight + cellHeight Or sectionFooterHeight + cellHeight Or sectionFooterHeight + cellHeight +sectionHeaderHeight
 @param headerViewHeight 表头高度
 */
+ (void)configFooterViewWithTabView:(UITableView *_Nullable)tableView
                              pages:(NSInteger )pages
                            pageNum:(NSInteger)pageNum
                              count:(NSInteger)count
                         cellHeight:(CGFloat)cellHeight
                   headerViewHeight:(CGFloat)headerViewHeight;


+ (void)configFooterViewWithTabView:(UITableView *_Nullable)tableView
                              pages:(NSInteger )pages
                            pageNum:(NSInteger)pageNum
                              count:(NSInteger)count
                         cellHeight:(CGFloat)cellHeight
                   headerViewHeight:(CGFloat)headerViewHeight
                              title:(NSString *_Nullable)title;



/**
 设置渐变色

 @param superView superView description
 @param starColor starColor description
 @param endColor endColor description
 */
+(void )gradientLayerWithSuperView:(UIView *_Nullable)superView
                         starColor:(UIColor *_Nullable)starColor
                          endColor:(UIColor *_Nullable)endColor
                        startPoint:(CGPoint)startPoint
                          endPoint:(CGPoint)endPoint
                         locations:(NSArray *_Nullable)locations;



/**
 配置视图阴影

 @param shadowView 配置阴影的视图
 @param color 阴影颜色
 @param opacity 阴影透明度
 @param offset 阴影的范围
 @param radius 阴影扩散的范围控制
 */
+ (void)shadowLayerWithView:(UIView *_Nullable)shadowView
                shadowColor:(UIColor *_Nullable)color
              shadowOpacity:(CGFloat)opacity
               shadowOffset:(CGSize)offset
               shadowRadius:(CGFloat)radius;
/**
 设置富文本属性

 @param label 标签
 @param font 字体
 @param range 富文本的范围
 @param color 富文本颜色
 */
+(void)attributedText:(UILabel *_Nullable)label
                 font:(id _Nullable )font range:(NSRange)range
                color:(UIColor *_Nullable)color;



/**
 获取尺寸

 @param label label description
 @return return value description
 */
+ (CGSize)attribut:(UILabel *_Nullable)label;
/**
 提示信息显示，不受类的限制

 @param msg msg description
 */
+ (void)showHUDWithMessage:(NSString *_Nullable)msg;



/**
 计算实体中是否含有多个元素的

 @param object 实体
 @return return value description
 */
+ (BOOL)hasManyObject:(id _Nullable )object;


/**
 计算实体中是否不为空

 @param object 实体
 @return return value description
 */
+(BOOL)isNotNull:(id _Nullable )object;

/**
 计算实体中是否为空
 
 @param object 实体
 @return return value description
 */
+(BOOL)isNull:(id _Nullable )object;



/**
 获取Window当前显示的ViewController

 @return ViewController
 */
+ (UIViewController*_Nullable)currentViewController;

+ (NSString *)UUID;
@end
